<template>
  <div class="person">
    <h2>当前求和为：{{ sum }}</h2>
    <h2>求和放大10倍：{{ bigSum }}</h2>
    <button @click="add">点我加一</button>
    <hr />
    <img v-for="(item, index) of dogList" :key="index" :src="item" /><br />
    <button @click="getDog">再来一只修狗</button>
  </div>
</template>

<script setup lang="ts" name="Person">
// 引入hooks
import useSum from "@/hooks/useSum";
import useDog from "@/hooks/useDog";
// 调用hook函数获取数据
const { sum, bigSum, add } = useSum();
const { dogList, getDog } = useDog();
</script>

<style scoped>
.person {
  background-color: skyblue;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}
button {
  margin: 0 5px;
}
li {
  font-size: 20px;
}
img {
  height: 100px;
  margin-right: 10px;
  border-radius: 5px;
}
</style>
